import request from "@utils/request";

/**
 * 首页
 * @returns {*}
 */
export function getHomeData() {
  return request.post("crmeb.getpageconfig", {}, { login: false });
}

/**
 * 文章详情
 * @returns {*}
 */
export function getStpreDetails(id) {
  return request.post("/storeDetail", { id: id }, { login: false });
}

/**
 * 文章 轮播列表
 * @returns {*}
 */
export function getArticleBanner(data) {
  return request.post("/advert.getAdvertList", data, { login: false });
}

/**
 * 文章分类列表
 * @returns {*}
 */
export function getArticleCategory() {
  return request.post("/subjectCategory/list", {}, { login: false });
}

/**
 * 文章 热门列表
 * @returns {*}
 */
export function getArticleHotList() {
  return request.post("/articles.getArticleList", {}, { login: false });
}

/**
 * 文章列表
 * @returns {*}
 */
export function getArticleList(q, cid) {
  return request.post("/articles.getArticleList", q, { login: false });
}

/**
 * 分享
 * @returns {*}
 */
export function getShare() {
  return request.post("/share", {}, { login: false });
}

/**
 * 文章详情
 * @returns {*}
 */
export function getArticleDetails(id) {
  return request.post(
    "/articles.getArticleDetail",
    { id: id },
    { login: false }
  );
}

/**
 * 获取微信sdk配置
 * @returns {*}
 */
export function getWechatConfig() {
  return request.post(
    "/wechat/config",
    { url: document.location.href },
    { login: false }
  );
}

/**
 * 获取微信sdk配置
 * @returns {*}
 */
export function wechatAuth(code, spread, login_type) {
  return request.post(
    "/wechat/auth",
    { code, spread, login_type },
    { login: false }
  );
}
/**
 * 获取快递公司
 * @returns {*}
 */
export function getLogistics() {
  return request.post("/logistics", {}, { login: false });
}
